#ifndef PAGETRACTION_H
#define PAGETRACTION_H

#include <QWidget>
#include <QLabel>
#include "global_def.h"

namespace Ui {
class PageTraction;
}

class PageTraction : public QWidget
{
    Q_OBJECT

public:
    explicit PageTraction(QWidget *parent = nullptr);
    ~PageTraction();
    void setTracStat(uint8_t item, uint8_t index, int16_t value);
private:
    Ui::PageTraction *ui;
    QList<QList <QLabel *>> m_lTracStatList;
    QStringList m_lTracStatNameList;
    QList<uint8_t> m_lTracStatCntOfOneCar;
    QLabel *m_pTotalKilometers;
private:
    void InitTracStatLabels();
    void SetPosition(QWidget* w, int car, uint8_t row, uint8_t col, uint8_t total, bool xReverse=false);
    void setDefaultStat();
private:
    float m_nStatLabelWidth_Car;
    float m_nStatLabelHeight;
    float m_nStatLabelStartY;
    float m_nStatLabelSpaceX;
    float m_nStatLabelSpaceY;
};

#endif // PAGETRACTION_H
